package string;

import javafx.util.Builder;

/**
 *string和StringBuilder的对比
 */

public class StringStringBuilderDemo {
    public static void main(String[] args) {
        StringBuilder builder = new StringBuilder("a");
        for (int i = 0; i < 10000000; i++) {//1000万次
            builder.append(i);


        }
        System.out.println("执行完毕");

        String s = "a";
        for (int i = 0; i < 10000000; i++) {//1000万次
            s = s + 1;

        }
        System.out.println("执行完毕");
    }
}